package com.simple.service.operator.impl;
import com.simple.dao.operator.operatorDao;
import com.simple.entity.operator.Operator;
import com.simple.service.operator.OperatorService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
@Transactional
public class OperatorServiceBean implements OperatorService {

    @Autowired
    public operatorDao operatorDao;


    @Override
    public Operator findOperatorById(int operatorId) {
        return operatorDao.findOperatorById(operatorId);
    }

    @Override
    public void addOperator(Operator operator) {
        if (operator != null)
         operatorDao.addOperator(operator);
    }

    @Override
    public void deleteOperator(int operatorId) {
        operatorDao.deleteOperator(operatorId);
    }

    @Override
    public void updateOperator(Operator operator) {
        operatorDao.updateOperator(operator);
    }

    @Override
    public List<Operator> findAllOperators() {
        return operatorDao.findAllOperators();
    }
}
